import{En as e,Ht as t,an as n,bn as r,g as i,pn as a,vn as o,xn as s}from"./CIxmKYxc4tZcJF.js";import{c,l,r as u,t as d}from"./BE8xqUWO2F54bE.js";function f(e){return typeof e==`object`&&!!e&&`$el`in e}function p(e){if(f(e)){let t=e.$el;return l(t)&&c(t)===`#comment`?null:t}return e}function m(t){return{name:`arrow`,options:t,fn(n){let r=p(e(t.element));return r==null?{}:d({element:r,padding:t.padding}).fn(n)}}}function h(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function g(e,t){let n=h(e);return Math.round(t*n)/n}function _(c,l,d){d===void 0&&(d={});let f=d.whileElementsMounted,m=i(()=>e(d.open)??!0),_=i(()=>e(d.middleware)),v=i(()=>e(d.placement)??`bottom`),y=i(()=>e(d.strategy)??`absolute`),b=i(()=>e(d.transform)??!0),x=i(()=>p(c.value)),S=i(()=>p(l.value)),C=o(0),w=o(0),T=o(y.value),E=o(v.value),D=s({}),O=o(!1),k=i(()=>{let e={position:T.value,left:`0`,top:`0`};if(!S.value)return e;let t=g(S.value,C.value),n=g(S.value,w.value);return b.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...h(S.value)>=1.5&&{willChange:`transform`}}:{position:T.value,left:t+`px`,top:n+`px`}}),A;function j(){if(x.value==null||S.value==null)return;let e=m.value;u(x.value,S.value,{middleware:_.value,placement:v.value,strategy:y.value}).then(t=>{C.value=t.x,w.value=t.y,T.value=t.strategy,E.value=t.placement,D.value=t.middlewareData,O.value=e!==!1})}function M(){typeof A==`function`&&(A(),A=void 0)}function N(){if(M(),f===void 0){j();return}if(x.value!=null&&S.value!=null){A=f(x.value,S.value,j);return}}function P(){m.value||(O.value=!1)}return t([_,v,y,m],j,{flush:`sync`}),t([x,S],N,{flush:`sync`}),t(m,P,{flush:`sync`}),n()&&a(M),{x:r(C),y:r(w),strategy:r(T),placement:r(E),middlewareData:r(D),isPositioned:r(O),floatingStyles:k,update:j}}export{_ as n,m as t};